Feat/df 1068: Add 'offline' as status filter option#803
Open
jbarnsley10 wants to merge 3 commits into
Open
Conversation
There was a problem hiding this comment.
Pull request overview
Adds support for 'offline' as a status filter option when listing forms. The filter enum is migrated from FormStatus to the new FormFilterStatus (from @defra/forms-model), which includes Offline alongside Draft and Live. The aggregation pipeline and filter conditions are extended to recognise documents with offline: true as the new "offline" status.
Changes:
- Replace
FormStatuswithFormFilterStatusin form-listing/filter code paths and corresponding tests. - Extend
buildFilterConditionsto mapFormFilterStatus.Offlineto{ offline: true }. - Extend
buildFiltersFacetto use a$switchso documents withoffline === trueare reported as'offline'(taking precedence over'live'/'draft').
Reviewed changes
Copilot reviewed 6 out of 6 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
| src/api/forms/repositories/aggregation/form-metadata-aggregation.js | Use FormFilterStatus; add Offline branch in buildFilterConditions and $switch in buildFiltersFacet. |
| src/api/forms/repositories/aggregation/form-metadata-aggregation.test.js | Update tests to use FormFilterStatus and assert new $switch aggregation. |
| src/api/forms/repositories/aggregation/types.js | Update JSDoc typedefs for the new $or shape and FormFilterStatus. |
| src/api/forms/repositories/form-metadata-repository.test.js | Switch test imports/usages to FormFilterStatus. |
| src/api/forms/service/definition.test.js | Switch test imports/usages to FormFilterStatus. |
| src/routes/forms.test.js | Update expected validation error messages to include offline. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Scullyon
approved these changes
May 19, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Ticket DF-1068
NOTE - need a model bump from designer PR DEFRA/forms-designer#1445